package com.ticket.sass.admin.dto.output.config;

import com.ticket.sass.common.entity.tenant.TicketRefundRuleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author ywb
 * @date 2024-03-25 10:26
 */
@Data
@ApiModel
public class TicketRefundRuleOutput {
    @ApiModelProperty(value = "ID", example = "0")
    private Long id;
   
    @ApiModelProperty(value = "取票状态：0未取票，1不限", example = "0")
    private Short takeTicketStatus;
    
    @ApiModelProperty(value = "开场范围：0开场前，1开场后", example = "0")
    private Short startScope;
    
    @ApiModelProperty(value = "时长（分钟）", example = "120")
    private Integer duration;
    
    @ApiModelProperty(value = "时长（分钟）", example = "120")
    private Short durationScope;
    
    @ApiModelProperty(value = "退改范围：0不允许，1 N元/张，2免费", example = "1")
    private Short scope;
    
    @ApiModelProperty(value = "退改手续费，N元/张", example = "10.50")
    private BigDecimal serviceCharge;
    
    public TicketRefundRuleOutput() {
    }
    
    public TicketRefundRuleOutput(TicketRefundRuleEntity entity) {
        this.id = entity.getId();
        this.takeTicketStatus = entity.getTakeTicketStatus().getValue();
        this.startScope = entity.getStartScope().getValue();
        this.duration = entity.getDuration();
        this.durationScope = entity.getDurationScope().getValue();
        this.scope = entity.getScope().getValue();
        this.serviceCharge = entity.getServiceCharge();
    }
}
